import { Schema, ValidationResult } from 'joi';

export class Validator {
  static of = (schmea: Schema) => new Validator(schmea);

  private constructor(private schema: Schema) {}

  public validate(value: any): ValidationResult {
    return this.schema.validate(value, { stripUnknown: true });
  }
}